/**
 * Author@ Cheng Feitian
 * Date: 2021-4-28
 * Description: 学习类模板语法
 */

#include <algorithm>
#include <iostream>
#include <string>

using namespace std;
const int maxn = 1024;

template <class NameType,class AgeType>
class Person
{
public:

    NameType m_Name;
    AgeType m_Age;

    //构造函数
    Person(NameType name,AgeType age){
        this->m_Age = age;
        this->m_Name = name;
    }

    //打印属性的函数
    void showPerson(){
        cout << "Name:" << this->m_Name << "\tAge:" << this->m_Age << endl;
    }
};

void test01(){
    Person<string,int> p1("孙悟空",100);
    p1.showPerson();
}

int main()
{
    test01();
    return 0;
}
